package com.cndym.api.discuz;

import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;


public class UCConfig {
    private static Map<String, String> map = new HashMap<String, String>();


    static {
        try {
            Properties properties = new Properties();
            InputStream inputStream = UCConfig.class.getResourceAsStream("/discuzeUC.properties");
            properties.load(inputStream);
            Enumeration all = properties.keys();
            while (all.hasMoreElements()) {
                String name = (String) all.nextElement();
                String value = (String) properties.get(name);
                map.put(name, value);
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    public static String getValue(String key) {
        if (map.containsKey(key)) {
            return map.get(key);
        }
        return "";
    }

    public static void update(String key, String value) {
        if (map.containsKey(key)) {
            map.put(key, value);
        }
    }


    public static final String UC_API = "UC_API";
    public static final String UC_IP = "UC_IP";
    public static final String UC_ENCODE = "UC_ENCODE";
    public static final String UC_KEY = "UC_KEY";
    public static final String UC_APP_ID = "UC_APP_ID";
    public static final String UC_CONNECT = "UC_CONNECT";
    public static final String UC_CLIENT_VERSION = "UC_CLIENT_VERSION";
    public static final String UC_CLIENT_RELEASE = "UC_CLIENT_RELEASE";


}